package com.spm.utils;

import com.spm.dao.StudentMapper;
import com.spm.pojo.Student;
import com.spm.pojo.StudentChooseCourse;

import java.util.List;

public class StudentMapperUtil extends MybatisUtils{
    private  StudentMapper mapper;

    public StudentMapperUtil() {
        mapper = getSqlSession().getMapper(StudentMapper.class);
    }

    //插入学生信息
    public  int insertStudent(Student stu){
        return this.mapper.insertStudent(stu);
    }
    //判断登录状态，0为失败，1为成功
    public  int selectIdAndPassword(String sid, String psw){
        return this.mapper.selectIdAndPassword(sid,psw);
    }

    public  int deleteSelectedCourse(String tid,String sid,String cno){return this.mapper.deleteSelectedCourse(tid,sid,cno);}

    public  int insertSelectedCourse(String tid,String sid,String cno){return this.mapper.insertSelectedCourse(tid,sid,cno);}

    public  List<StudentChooseCourse> selectClassChooseStudentListByTnoAndCno(String tid,String cno){return this.mapper.selectClassChooseStudentListByTnoAndCno(tid,cno);}
}
